﻿using Max.PH4_2102A.Shopping.Domain;
using Max.PH4_2102A.Shopping.IRespository;
using Max.PH4_2102A.Shopping.IService;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Max.PH4_2102A.Shopping.Service
{
    /// <summary>
    /// 品牌分类服务
    /// </summary>
    public class BrandCategoryService: IBrandCategoryService
    {
        IBrandCategoryRespository _respository;
        /// <summary>
        /// 构造函数注入品牌仓储接口
        /// </summary>
        /// <param name="respository"></param>
        public BrandCategoryService(IBrandCategoryRespository respository)
        {
            _respository = respository;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int Delete(BrandCategoryModel model)
        {
            return _respository.Delete(model);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="BrandCategorys"></param>
        /// <returns></returns>
        public int Delete(List<BrandCategoryModel> models)
        {
            return _respository.Delete(models);
        }


        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public IQueryable<BrandCategoryModel> GetAll()
        {
            return _respository.Query();
        }


        /// <summary>
        /// 
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public int Insert(BrandCategoryModel model)
        {
            return _respository.Insert(model);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int Update(BrandCategoryModel model)
        {
            return _respository.Update(model);
        }
    }
}
